<?php
/**
+--------------------------------------------------------------
 * User: maqun
+--------------------------------------------------------------
 * Date: 2015/12/25
+--------------------------------------------------------------
 * Time: 14:03
+--------------------------------------------------------------
 * 论坛链接
+--------------------------------------------------------------
 */
class BbsAction extends Action{

    protected  $oj_bbs = "http://coder.buct.edu.cn/bbs";

    public function index(){

        if(isset($_GET['pid']))
            $pid=intval($_GET['pid']);
        else
            $pid=0;
        if(isset($_GET['cid']))
            $cid=intval($_GET['cid']);
        else
            $cid=0;
        if($this->oj_bbs=="discuss"){
            echo ("<script>location.href='discuss/discuss.php?".$_SERVER["QUERY_STRING"]."';</script>");
        }else{
            $url="";
            if(isset($_GET['pid'])){
                $url=("bbs/search.php?fid[]=2&keywords=".$pid); //chenge this to your own phpBB search link
            }else{
                $url=("bbs/");
            }
            $url = $this->oj_bbs;
            echo ("<script>location.href='".$url."';</script>");
        }
    }
}